//
//  LKMineAchieveInformViewController.m
//  YLHelper
//
//  Created by she1323 on 2018/5/15.
//  Copyright © 2018年 she1323. All rights reserved.
//

#import "LKMineAchieveInformViewController.h"
#import "XXPageTabView.h"
#import "LKYearViewController.h"
#import "LKChoosePKTypeViewController.h"
#import "LKInstrumentBoardViewController.h"

@interface LKMineAchieveInformViewController ()<XXPageTabViewDelegate,UINavigationControllerDelegate>
@property(nonatomic,strong)CombinedChartView *comChartView;
@property (nonatomic, strong) XXPageTabView *pageTabView;
@end

@implementation LKMineAchieveInformViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUpPageTabView];
    // Do any additional setup after loading the view.
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController.navigationBar setBarTintColor:blueDefault];
    //设置导航条文字颜色 白色
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    self.navigationController.delegate = self;
}

-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [self.navigationController.navigationBar setBarTintColor:[UIColor whiteColor]];
    //设置导航条文字颜色 白色
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:COLOR_HEX(0x000000)}];

}
-(void)setNavgationBackBtn{
    [super setNavgationBackBtn];
    [self.backButton setTitleColor:[UIColor whiteColor]];
    [self.backButton setImage:[UIImage imageNamed:@"back2"] forState:UIControlStateNormal];
    
}
- (void)setUpPageTabView
{
    WS(weakSelf)
    LKYearViewController *vc1 = [[LKYearViewController alloc] init];
    LKYearViewController *vc2 = [[LKYearViewController alloc] init];
    LKYearViewController *vc3 = [[LKYearViewController alloc] init];
    [vc3.pushSubject subscribeNext:^(id  _Nullable x) {
        LKChoosePKTypeViewController *vc = [[LKChoosePKTypeViewController alloc] init];
        [weakSelf.navigationController pushViewController:vc animated:YES];
    }];
    [self addChildViewController:vc1];
    [self addChildViewController:vc2];
    [self addChildViewController:vc3];
    //支持网易云音乐，今日头条，微博等切换栏效果
    self.pageTabView = [[XXPageTabView alloc] initWithChildControllers:self.childViewControllers childTitles:@[@"日",@"月",@"年"]];
    
    self.pageTabView.frame = CGRectMake(0, NAVIGATION_BAR_HEIGHT, WIDTH, self.view.frame.size.height - NAVIGATION_BAR_HEIGHT );
    self.pageTabView.tabSize = CGSizeMake(WIDTH, 44.0f);
    self.pageTabView.selectedColor = blueDefault;
    self.pageTabView.separatorColor = [UIColor clearColor];
    self.pageTabView.unSelectedColor = [UIColor lightGrayColor];
    self.pageTabView.delegate = self;
    self.pageTabView.indicatorHeight = 2;
    self.pageTabView.titleStyle = XXPageTabTitleStyleDefault;
    self.pageTabView.indicatorStyle = XXPageTabIndicatorStyleDefault;
    self.pageTabView.indicatorWidth = WIDTH / 375 * 55;
    [self.view addSubview:self.pageTabView];
}


-(void)pageTabViewDidEndChange{
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
